﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;

namespace WebApplicationTestJs.Models
{
    /// <summary>
    /// 默認js代碼有錯，也壓縮
    /// </summary>
    public class ScriptBundle2 : Bundle
    {
        public ScriptBundle2(string virtualPath) : this(virtualPath, null, true)
        {
        }

        /// <summary>
        /// 構造函數
        /// </summary>
        /// <param name="virtualPath"></param>
        /// <param name="codeIgnoreAllErrors">是否忽略js代碼錯誤</param>
        public ScriptBundle2(string virtualPath, bool codeIgnoreAllErrors=true) : this(virtualPath, null, codeIgnoreAllErrors)
        {
        }

        public ScriptBundle2(string virtualPath, string cdnPath, bool codeIgnoreAllErrors = true) : base(virtualPath, cdnPath, new IBundleTransform[]
        {
            new JsMinify2(){ CodeIgnoreAllErrors=codeIgnoreAllErrors }
        })
        {
            base.ConcatenationToken = ";" + Environment.NewLine;
        }

    }
}